package model;

import java.util.List;

import DTO.TrainDTO;

/**
 * This is an interface that provides a complete business transactions with 
 * an entity of Train
 */
public interface Train {
	
	/**
	 * This method checks if there is a train in DB which has the same 
	 * DTO implementation as the given DTO. If it is NOT found in DB, method 
	 * creates a new Train entity from DTO and saves it.
	 * 
	 * @param trainDTO - DTO of train which is required to be removed
	
	 */
	public void saveUniqueTrain(TrainDTO trainDTO);
	
	/**
	 * This method checks if there is a train in DB which has the same 
	 * DTO implementation as given DTO. If it is found in DB, method 
	 * removes it.
	 * 
	 * @param trainDTO - DTO of train which is required to be removed
	
	 */
	public void removeUniqueTrain(TrainDTO trainDTO);
	
	/**
	 * Method looks for all the Train entities in DB.
	 * 
	 * @return	- List of all Train entities in DB or null if there is no
	 * 			  train in DB.
	 */
	public List<model.impl.Train> findAll();
}
